package com.xncoding.pos.conn;

import java.net.Socket;

public class AgentOptions {
    public static void main(String[] args) {
        connect("127.0.0.1", 6300);
    }

    //远程连接
    public static void connect(String host, int port) {
        try {
            Socket sock = new Socket(host, port);
            // 创建一个写线程
            new TelnetWriter(sock.getOutputStream()).start();
            // 创建一个读线程
            new TelnetReader(sock.getInputStream()).start();
        } catch (Exception e) {
            // TODO: handle exception
        }
    }
}
